<template>
  <view class="container">
    adsgasd
    <z-paging
      ref="paging"
      v-model="itemList"
      @query="queryList"
      :fixed="true"
      :empty-view-img="`${getImageUrl('empty.png')} `"
      empty-view-text="暂无数据~"
      :empty-view-img-style="imgStyle"
    >
      <view slot="top">
        <u-navbar height="50" title="点赞" title-size="36" title-color="#333"></u-navbar>
        <u-gap height="20" bg-color="#F0F1F2"></u-gap>
      </view>
      <view class="">
        <view class="video-area">
          <view
            class="video-area-box"
            @click="play(item)"
            v-for="(item, index) in itemList"
            :key="index"
          >
            <image class="video-area-cover" :src="item.coverUrl" mode=""></image>
          </view>
        </view>
      </view>
    </z-paging>
  </view>
</template>

<script>
export default {
  data() {
    return {
      imgStyle: {
        width: '12rem'
      },
      current: 0,
      scurrent: 0,
      test: [1, 2, 3, 4, 5],
      itemList: [
        {
          coverUrl: ''
        }
      ],

      order_id: ''
    }
  },
  onLoad(res) {
    this.queryList()
  },

  methods: {
    queryList(pageNo = 1, pageSize = 10) {
      this.$u
        .get(`/app-api/vlog/info/liked-page?pageNo=${pageNo}&pageSize=${pageSize}`)
        .then((res) => {
          this.$refs.paging.complete(res.data.list)
        })
    },
    play(item) {
      //this.itemList[2]
      uni.navigateTo({
        url:
          '/other/video-play/video-play?videoList=' +
          JSON.stringify([item]) +
          '&play=' +
          JSON.stringify(item)
      })
    },
    onOrderCancel(item) {
      let self = this
      uni.dialog.confirm('温馨提示', '确定要取消订单吗？', () => {
        self.$u.api.setOrderCancel(item.id).then((res) => {
          self.$u.toast('取消成功')
          setTimeout(function () {
            self.onOrderLoad(self.current, null, true)
          }, 500)
        })
      })
    },

    onOrderConfrim(item) {
      let self = this
      uni.dialog.confirm('温馨提示', '该订单确认收货吗？', () => {
        self.$u.api.setOrderConfirm(item.id).then((res) => {
          self.$u.toast('收货成功')
          setTimeout(function () {
            self.onOrderLoad(self.current, null, true)
          }, 500)
        })
      })
    },
    onResellPush(item) {
      this.$utils.route({
        url: '/goods/resell-push/resell-push',
        params: {
          id: item.id
        }
      })
    },
    onPushComment(item) {
      this.$utils.route({
        url: '/other/push-comment/push-comment',
        params: {
          id: item.id
        }
      })
    },

    routeTo() {
      uni.navigateTo({
        url: '/goods/goods-details/goods-details'
      })
    }
  }
}
</script>

<style lang="scss" scoped>
page {
  height: 100%;
  background: #f0f1f2;
}

.video-area {
  &-box {
    float: left;
    width: 33%;
    height: 400rpx;
    .video-area-cover {
      width: 100%;
      height: 100%;
    }
  }
}
</style>
